import api from './index';

// 获取任务执行历史
export const getTaskExecutions = (taskId) => {
  return api.get(`/tasks/${taskId}/executions`);
};

// 更新任务执行状态
export const updateTaskExecution = (executionId, updateData) => {
  return api.put(`/executions/${executionId}`, updateData);
};

// 添加执行备注
export const addExecutionComment = (executionId, comment) => {
  return api.post(`/executions/${executionId}/comments`, comment);
};

// 获取执行详情
export const getExecutionDetails = (executionId) => {
  return api.get(`/executions/${executionId}`);
};

// 回滚任务执行
export const rollbackExecution = (executionId, reason) => {
  return api.post(`/executions/${executionId}/rollback`, { reason });
};

// 审核任务执行
export const reviewExecution = (executionId, reviewData) => {
  return api.post(`/executions/${executionId}/review`, reviewData);
}; 